﻿CREATE PROCEDURE [dbo].[ComponentInsert]
(@ComponentID UniqueIdentifier,
@WorkflowID UniqueIdentifier,
@AssemblyFileName varchar(255),
@ComponentTypeName varchar(500))
AS begin
	if exists (select * from Component where ComponentID=@ComponentID) begin
		update Component set 
			WorkflowID=@WorkflowID,
			AssemblyFileName=@AssemblyFileName,
			ComponentTypeName=@ComponentTypeName
		where
			ComponentID=@ComponentID;
	end
	else begin
		insert into Component (
			ComponentID,
			WorkflowID,
			AssemblyFileName,
			ComponentTypeName) 
		values (
			@ComponentID,
			@WorkflowID,
			@AssemblyFileName,
			@ComponentTypeName);
	end
end